package edu.sctu.practice.class02.yangshengyu.two10;

/**
 * Created by Cullen on 2015/8/11.
 */
public class N20 {
    public static void main(String[] args) {
        double y=1;
        double a=2;
        for (int i=1;i<=100;i++){
            if (i%2==0){
                y=y-(1/i);
                break;
            }else y=y+(1/i);
            break;
        }
        System.out.println("1-1/2+1/3-1/+...+1/99-1/100 ="+y);
    }
}
